#include<iostream>
#include<algorithm>

using namespace std;

const int N = 1010;
int n, x;
int q[N];

bool check(){
    for (int i = 0; i < n; i++)
    {
        if (q[i + n] - q[i] < x)
        {
            return false;
        }
    }

    return true;
}

int main(){
    // ios::sync_with_stdio(false);
    // cin.tie(nullptr);
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    int T;
    cin >> T;

    while(T--){
        cin >> n >> x;
        for (int i = 0; i < 2 * n; i ++){
            cin >> q[i];
        }

        sort(q, q + n * 2);
        if(!check()){
            cout << "NO" << endl;
        }else{
            cout << "YES" << endl;
        }
    }

    return 0;
}